//用户模块的请求

import axios from "../utils/config";

//用户登录
/**
 * 
 * @param {Object} data 是一个对象，对象需要传递username  password 
 * @returns {Promise} 返回值是一个promise
 */
export const loginApi = (data={}) =>axios.post('/users/login',data)

//获取验证码

export const getCaptchaApi = ()=>axios.get('/users/getCaptcha')



//校验验证码
/**
 * 
 * @param {String} captcha 用户输入的验证码 
 * @returns  {Promise} 返回一个promise
 */

export const verifyCaptchApi = captcha=>axios.get(`/users/verifyCaptcha?captcha=${captcha}`)

//获取微信二维码url

export const getQrcodeApi =sid=>axios.get('/users/getQrcode',{
    params:{
        sid
    }
})
 
//微信登陆

export const wechatLoginApi = wechatCode =>axios.get('/users/wechatLogin',{
    params:{
        wechatCode
    }
})